CC=gcc
EXECUTABLE=fiber_test
EXECUTABLE2=fiber_test2
EXECUTABLE3=fiber_test3
CLIB_FLAGS= -L../src/

all: $(EXECUTABLE) $(EXECUTABLE2) $(EXECUTABLE3)

$(EXECUTABLE): main.o
	gcc -g -Wall -I../src/ $(CLIB_FLAGS) -o $(EXECUTABLE) main.o -lfiber

main.o: main.c
	gcc -g -Wall -I../src/ -c -o main.o main.c

$(EXECUTABLE2): example2.o
	gcc -g -Wall -I../src/ $(CLIB_FLAGS) -o $(EXECUTABLE2) example2.o -lfiber

example2.o: example2.c
	gcc -g -Wall -I../src/ -c -o example2.o example2.c

$(EXECUTABLE3): example3.o
	gcc -g -Wall -I../src/ $(CLIB_FLAGS) -o $(EXECUTABLE3) example3.o -lfiber

example3.o: example3.c
	gcc -g -Wall -I../src/ -c -o example3.o example3.c

clean:
	rm *.o
	rm $(EXECUTABLE)
	rm $(EXECUTABLE2)
	rm $(EXECUTABLE3)
